const path = require('path')
const nuxtConfig = require('./nuxt.config')
module.exports = {
  webpack: (config, options, webpack) => {
    config.entry.main = [path.join(__dirname,'server/index.js')]
    config.output.path = path.join(__dirname,nuxtConfig.buildDir)
    if(!nuxtConfig.dev){
      config.output.filename = '[name].js'
      config.output.sourceMapFilename = '[name].map'
    }
    return config
  }
}
